import minRequest from '@/utils/request'

// 查询锁定的码头
export function wharfList(params) {
  return minRequest.get(`/system_setting/wharf/list`, params)
}

// 修改仓库码头表
export function updateWharf(params) {
  return minRequest.put(`/system_setting/wharf`, params, { noFormHasValue: false })
}

// 根据托盘码查询仓库imsId
export function latestImsStockOutRecord(palletCode) {
  return minRequest.get(`/ims_data/imsStockOutRecord/latestImsStockOutRecord/${palletCode}`)
}

// 查询配置
export function listConfig(params) {
  return minRequest.get('/system_setting/ims/config/list', params)
}

// 更新配置 开启手动控制
export function updateConfig(params) {
  return minRequest.put('/system_setting/ims/config', params)
}

// 查询仓库库位
export function stationList(params) {
  return minRequest.get(`/system_setting/station/list`, params)
}

// 库存数据
export async function imsStockList(params) {
  return minRequest.get('/ims_data/imsStock/listForInventory', params)
}

// 库存数据详情
export async function imsStockDetail(id) {
  return minRequest.get(`/ims_data/imsStock/${id}`)
}

// 根据托盘码查询列表数据
export async function palletCodeSkuList(params) {
  return minRequest.get(`/ims/palletCodeSku/list/`, params)
}

// 盘点回库
export function addInventory(query) {
  return minRequest.post('/ims_data/imsStockInWork/addInventory', query)
}

// 开始盘点
export async function imsStockOutWorkAdd(params) {
  return minRequest.post(`/ims_data/imsStockOutWork/addInventory`, params)
}

// 审批
export async function inventory(params) {
  return minRequest.post(`/ims/inventory`, params)
}
